#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include<QSqlDatabase>
#include<QSqlDriver>
#include<QSqlField>
#include<QSqlQuery>
#include<QSqlRecord>
#include<QSqlError>
#include<QSqlIndex>
#include<QDebug>

#include<QTextBrowser>
#include<QTextEdit>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    QSqlDatabase db;
    int count_number;
    int LastnumIndex=0;
    int getDBRecordCount();
    bool createDB();
    bool createDBtable();
    bool insertDB(int id,QString name,QString sex,float score);
    void displayDB();
    void startSystem();
    void StuatelabelSetText();
    void StuatelabelSetText(int a);
    bool seachHasID(int idnum);


private slots:

    void on_Insert_pushButton_clicked();
    void on_showData_Button_clicked();
    void on_DeleteAll_pushButton_clicked();
    void on_DeleteThis_pushButton_clicked();
    void on_Search_pushButton_clicked();
};

#endif // MAINWINDOW_H
